package com.base.vistter.iframe.inverter.configurer;

import com.base.vistter.iframe.inverter.interceptor.SafetyInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
@Slf4j
public class SystemConfigurer implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        log.info("进入拦截器方法");
        registry.addInterceptor(SafetyInterceptor()).addPathPatterns("/**").order(3);
    }

    @Bean
    public SafetyInterceptor SafetyInterceptor(){
        return new SafetyInterceptor();
    }

}